import request from '../../utils/request';
import { OnionUtils } from '../../utils/onion-utils';

//查询数据字典索引列表
export const fetchData = queryData => {
    return request({
        url: '/api/resic/dict/listPage',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'queryData'},
        buildType : 'queryData',
        data: queryData
    });
};

//保存数据字典索引信息
export const saveData = formData => {
    return request({
        url: '/api/resic/dict/saveIndex',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: formData
    });
};

//获取数据字典索引信息
export const getData = paramData => {
    return request({
        url: '/api/resic/dict/getIndex',
        method: 'post',
        header:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
};

//删除数据字典索引
export const deleteData = paramData => {
    return request({
        url: '/api/resic/dict/deleteIndex',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
};

//根据indexCode查询数据字典明细列表
export const fetchDictByIndex = queryData =>{
    return request({
        url: '/api/resic/dict/listItemsByIndex',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: queryData
    });
}

//查询数据字典明细列表
export const fetchDictItems = queryData =>{
    return request({
        url: '/api/resic/dict/findDictItems',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: queryData
    });
}

//分页查询数据字典明细列表
export const fetchItemsByPage = queryData =>{
    return request({
        url: '/api/resic/dict/listItemsByPage',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: queryData
    });
}

//获取数据字典明细信息
export const getDictItem = paramData =>{
    return request({
        url: '/api/resic/dict/getItem',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
}

//保存数据字典明细
export const saveDictItem = formData => {
    return request({
        url: '/api/resic/dict/saveItem',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: formData
    });
}

//删除数据字典明细
export const deleteDictItem = paramData =>{
    return request({
        url: '/api/resic/dict/deleteItem',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
}